package org.codehaus.mojo.wagon.shared;

import org.apache.maven.plugin.logging.Log;
import org.apache.maven.wagon.Wagon;
import org.apache.maven.wagon.WagonException;

import java.util.List;

/**
 *
 */
public interface WagonDownload {

    /**
     * @param wagon   - a Wagon instance
     * @param fileSet - Criteria to build the list
     * @param logger  - logger used
     * @return a list of files at the remote host relative to RemoteFileSet's directory
     * @throws WagonException if any wagon error
     */
    List getFileList(Wagon wagon, WagonFileSet fileSet, Log logger) throws WagonException;

    /**
     * @param wagon         - a Wagon instance
     * @param remoteFileSet - Criteria to build the list
     * @param logger        - logger used
     * @throws WagonException if any wagon error
     */
    void download(Wagon wagon, WagonFileSet remoteFileSet, Log logger) throws WagonException;

    /**
     * @param wagon    - a Wagon instance
     * @param resource - resource to test
     * @return {@code true} if found, {@code false} otherwise
     * @throws WagonException if any wagon error
     */
    boolean exists(Wagon wagon, String resource) throws WagonException;

}
